#ifndef	__LIBCORE_VALGRIND_H__
#define	__LIBCORE_VALGRIND_H__

#if WITH_VALGRIND
#include <valgrind/memcheck.h>
#ifndef VALGRIND_MAKE_MEM_NOACCESS
/* A little glue for older valgrind version prior to 3.2.0 */
#define VALGRIND_MAKE_MEM_NOACCESS VALGRIND_MAKE_NOACCESS
#define VALGRIND_MAME_MEM_UNDEFINED VALGRIND_MAME_WRITABLE
#define VALGRIND_MAKE_MEM_DEFINED VALGRIND_MAKE_READABLE
#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE VALGRIND_CHECK_WRITABLE
#endif
#else
#define VALGRIND_MAKE_MEM_NOACCESS(a,b) (0)
#define VALGRIND_MAKE_MEM_UNDEFINED(a,b) (0)
#define VALGRIND_MAKE_MEM_DEFINED(a,b) (0)
#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,b) (0)
#define VALGRIND_CHECK_MEM_IS_DEFINED(a,b) (0)
#define VALGRIND_MALLOCLIKE_BLOCK(a,b,c,d)
#define VALGRIND_FREELIKE_BLOCK(a,b)
#define RUNNING_ON_VALGRIND 0
#endif /* WITH_VALGRIND */


#endif
